<?php

namespace App\Models;

use App\Models\Contract\SerializeDatetime;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class UserWalletActive extends Model
{
    use HasFactory, SerializeDatetime;

    protected $fillable = [
        'user_id', 'user_withdraw_id', 'operator_id', 'wallet_type', 'action', 'coins',
        'before_reward_coins', 'after_reward_coins', 'before_commission_coins',
        'after_commission_coins', 'status', 'changed_at',
    ];

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function withdraw()
    {
        return $this->hasOne(UserWithdraw::class, 'id', 'user_withdraw_id');
    }
}
